<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      .box {
        width: 300px;
        height: 300px;
        background-color: bisque;
      }
    </style>
  </head>
  <body>
    <div class="box"></div>
    <button class="show">显示</button>
    <button class="hide">隐藏</button>
    <button class="toggle">切换</button>

    <script src="jquery/jquery-3.6.1.js"></script>

    <script>
      let box = $(".box");
      $(".show").click(function () {
        box.fadeIn("slow");
        // box.slideDown("slow");
        // box.show("slow", () => {
        //   console.log("显示");
        // });
        // box.css("display", "block");
      });

      $(".hide").on("click", () => {
        box.fadeOut("slow");
        // box.slideUp("slow");
        // box.hide("slow");
        // box.css("display", "none");
      });

      $(".toggle").on("click", () => {
        box.toggle("slow");
      });
    </script>
  </body>
</html>
